package com.example.store2.Mapper;

import com.example.store2.pojo.Resources;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ResourcesMapper {

    List<Resources> list(Integer id,Integer classesId, String resourcesName);

    /**
     * 添加资源
     * @param resources
     * @return
     */
    void add(Resources resources);

    /**
     * 查询当前添加资源的id值
     * @return
     */
    @Select("select max(id) from resources")
    Integer nowadd();

    /**
     * 删除资源
     * @param id
     * @return
     */
    @Delete("delete from resources where id=#{id}")
    void delete(Integer id);

    /**
     * 修改资源
     * @param resources
     * @return
     */
    @Update("update resources set resources_name=#{resourcesName},classes_id=#{classesId},introduce=#{introduce},address=#{address}where id=#{id}")
    void update(Resources resources);
}
